
import os
import sys
import pandas as pd

# 设置项目根目录
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../"))
if BASE_DIR not in sys.path:
    sys.path.insert(0, BASE_DIR)

from src.missing.fill_methods import process_missing_values

# 输入文件路径
input_file = os.path.join(BASE_DIR, "data", "2_missing_value_analysis", "filled", "to_fill_by_indicator", "S4_missing_data.csv")
df = pd.read_csv(input_file, encoding="utf-8-sig")

# 提取指标与国家
indicator_list = ['S4']
country_list = df['国名Ch'].dropna().unique()

# 输出目录
output_root = os.path.join(BASE_DIR, "data", "2_missing_value_analysis", "filled")

# 执行交互式缺失值处理
process_missing_values(df, indicator_list, country_list, output_root)
